﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Snowdreamist.Windows.Document
{
    [Serializable]
    [XmlRoot(ElementName = "documentResources", Namespace = Utility.Namespace)]
    internal class DocumentResources
    {
        [XmlElement(ElementName = "collection", Namespace = Utility.Namespace)]
        public Dictionary<Guid, DocumentResource> Collections { get; set; }
    }

    [Serializable]
    [XmlRoot(ElementName = "documentResource", Namespace = Utility.Namespace)]
    internal class DocumentResource
    {
        /// <summary>
        /// Key
        /// </summary>
        [XmlAttribute(AttributeName = "key", Namespace = Utility.Namespace)]
        public Guid Key { get; set; }
        /// <summary>
        /// Value
        /// </summary>
        [XmlElement(ElementName = "value", Namespace = Utility.Namespace)]
        public List<DocumentMetaResource> Values { get; set; }
    }

    [Serializable]
    [XmlRoot(ElementName = "documentMetaResource", Namespace = Utility.Namespace)]
    internal class DocumentMetaResource
    {
        [XmlAttribute(AttributeName = "key", Namespace = Utility.Namespace)]
        public string Key { get; set; }
        [XmlAttribute(AttributeName = "type", Namespace = Utility.Namespace)]
        public string Type { get; set; }
        [XmlAttribute(AttributeName = "filename", Namespace = Utility.Namespace)]
        public string Filename { get; set; }
    }
}
